home *** CD-ROM | disk | FTP | other *** search
- -- card: 2897 from stack: in
- -- bmap block id: 4048
- -- flags: 0000
- -- background id: 2702
- -- name: Command
- ----- HyperTalk script -----
- on openCard
- global bookNumber,initGlobals
- idle
-
- if initGlobals is false
- then put bookNumber into card field "Book Number"
- end openCard
-
- on initGlobals
- answer "it works"
- end initGlobals
-
- on idle
- global timeInt
- if (the seconds - timeInt > 30) then
- put the long date into todayDate1
- put the seconds into todayDate2
-
- convert todayDate2 to time
- put todayDate1&" "&todayDate2 into card field "today's date"
- put the seconds into timeInt
- end if
- end idle
-
-
-
-
- -- part 1 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=20 top=226 right=261 bottom=222
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Make a Batch of New Cards
- ----- HyperTalk script -----
- on mouseUp
- ask "Make how many new card sets?"
- put it into num
- if num is not empty then
- put the long date into card field "today's date"
- set lockScreen to true
- push card
- go to card 1 of stack "Acquisitions"
-
- put "To stop, click the mouse and wait a moment."
- repeat with index =1 to num
- send mkNewCard to stack "Acquisitions"
- if index is 1 then
- put index&&"set completed. To stop, click the mouse and wait a moment."
- else
- put index&&"sets completed. To stop, click the mouse and wait a moment."
- end if
- if the mouseClick then exit repeat
- end repeat
-
- hide message box
- if index is 1 then
- answer index&&"card set completed."
- else
- answer index&&"card sets completed."
- end if
- pop card
- set lockScreen to false
- end if
- end mouseUp
-
-
-
- -- part 2 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=103 top=81 right=96 bottom=139
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Go To Acquisition
- ----- HyperTalk script -----
- on mouseUp
- visual barn door open
- go to stack "Acquisitions"
- end mouseUp
-
-
-
- -- part 5 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=369 top=270 right=291 bottom=495
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Find Overdues
- ----- HyperTalk script -----
- ----------------------- Open Stack‚Ñ¢ Copyright 1987----------------------
- ----------------------- by the Walking Shadow Press --------------------
- on mouseUp
- ----------------------------------------------------------------
- -- This handler updates the overdue notice stack "Overdue". --
- -- It proceeds by first deleting the cards in the current --
- -- "Overdue" stack and then recreates it by examining the --
- -- circulations stack to determine all overdue books. --
- -- --
- -- A new overdue card is created and filled with patron --
- -- information for each overdue book found. --
- ----------------------------------------------------------------
-
- -------------------------------------------------------------------
- -- This routine makes use of times that have been converted to --
- -- the seconds format. When a time is converted to seconds, --
- -- it becomes the number of seconds since Jan 1, 1904. --
- -- First, we convert today's date to seconds... --
- -------------------------------------------------------------------
- put the short date into todayDate
- convert todayDate to seconds
-
- set cursor to 4
- ---------------------------------------------------------------------
- -- The next command wipes the time out of the "today's date" field --
- -- because it won't be updated while this routine is running. --
- -- This way, a user won't see an incorrect time on the screen. --
- ---------------------------------------------------------------------
- put the long date into card field "today's date"
- set lockScreen to true
- push card
-
- go to stack "Overdue"
-
- ------------------------------------------------------------------
- -- We start the overdue stack over by deleting all its cards... --
- ------------------------------------------------------------------
- put the number of cards into numCards
- repeat for numCards-1 times
- doMenu "Delete Card"
- end repeat
-
- ---------------------------------------------------------------
- -- The last card can't be deleted, so we empty its fields --
- -- instead... --
- -- First empty the card fields, if there are any... --
- ---------------------------------------------------------------
- repeat with i = 1 to the number of card fields
- put empty into card field i
- end repeat
-
- -- ... and next, the background fields. --
- repeat with i = 1 to the number of fields
- put empty into field i
- end repeat
-
- ---------------------------------------------------------------
- -- Now we go to the circulation stack and look for overdue --
- -- books. --
- ---------------------------------------------------------------
- go to stack "Circulation"
-
- ---------------------------------------------------------------
- -- The count variable keeps track of the number of overdue --
- -- books found. It will be used shortly. --
- ---------------------------------------------------------------
- put 0 into count
-
- -----------------------------------------------------------------
- -- Now we loop through all the cards of the circulation stack --
- -- to see whether or not each book is overdue. --
- -----------------------------------------------------------------
- repeat for the number of cards
- ---------------------------------------------------------
- -- The processCircCard handler cleans the "Circ Field" --
- -- up by deleting all empty lines and white space. --
- ---------------------------------------------------------
- processCircCard
-
- -----------------------------------------------------------------
- -- The following block of code is the main part of this --
- -- routine. For each card in the circulation stack, the book --
- -- it represents has been returned if the "Returned" field --
- -- is 1. --
- -- --
- -- So, if the "Returned" field is 1, we skip everything and --
- -- go on to the next card. --
- -- --
- -- The next condition checks to see if the entire "Circ field" --
- -- field is empty, in which case we also skip everything and --
- -- go on to the next card. --
- -- --
- -- The words of each line of field "Circ Field" consist of: --
- -- (checkout date) (due date) (patron number). --
- -- --
- -- The patron number is checked to see if it exists. If it --
- -- doesn't, something is wrong, and an error is flagged. --
- -- --
- -- Provided all of the above checks out ok, the due date is --
- -- next converted to seconds and compared to today's date. --
- -- If the due date is less than today's date, the book is --
- -- overdue, so we process the overdue card in the handler --
- -- processOverdue by passing it the patron's number, the --
- -- date the book is due, and the number of overdue books --
- -- found so far (See the comments in processOverdue.). --
- -----------------------------------------------------------------
- if field "Returned" is not 1 then
- put last line of field "Circ Field" into lastLine
- if (lastLine is not empty) then
- put word 3 of lastLine into patronNumber
- if patronNumber is not empty then
- put word 2 of lastLine into dueDate
- convert dueDate to seconds
- if dueDate < todayDate then
- add 1 to count
- convert dueDate to short date
- processOverdue patronNumber, dueDate, count
- end if
- else
- -- Flag circ card error, patron number is empty.
- end if
- end if
- end if
- go to next card
- end repeat
-
- pop card
- set lockScreen to false
- end mouseUp
-
- on processCircCard
- ---------------------------------------------------------------
- -- This routine processes each circulation card by deleting --
- -- any empty lines in its "Circ Field" field. If the first --
- -- word of a line is empty, it means no words at all --
- -- exist on that line, so the line is deleted. --
- ---------------------------------------------------------------
-
- repeat with i = the number of lines in field "Circ Field" down to 1
- if word 1 of line i of field "Circ Field" is empty then
- delete line i of field "Circ Field"
- end if
- end repeat
- end processCircCard
-
- on processOverdue patronNumber, dueDate, count
- -----------------------------------------------------------------
- -- This handler processes an overdue book that appears on --
- -- the current circulation card. --
- -- We must gather information about the patron to make an --
- -- overdue card for the "Overdue" stack. --
- -- --
- -- First, we get some info. from the current circulation card. --
- -----------------------------------------------------------------
-
- put field "author" into bookAuthor
- put field "title" into bookTitle
- put field "book Number" into bookNumber
-
- --------------------------------------------------------------
- -- Next, we pass to the "Patron" stack to gather more info. --
- -- on the patron. --
- --------------------------------------------------------------
- push card
- go to stack "Patron"
-
- ------------------------------------------------------------------
- -- We must first find the proper patron's card in the "Patron" --
- -- stack. --
- -- If there is no card for the patron's number, something is --
- -- wrong and an error should be flagged. --
- ------------------------------------------------------------------
- find patronNumber in field "Patron Number"
- if patronNumber is not field "Patron Number" then
- -- Flag error, patron doesn't exist.
- else
- put field "Patron Name" into patName
- put field "Patron Address" into patAddress
-
- -------------------------------------------------------------------
- -- Finally we go to the "Overdue" stack and load the information --
- -- that has been gathered onto an overdue card notice. --
- -- --
- -- Count records how many overdues have been processed. If it --
- -- is 1, we need not create a new card on the "Overdue" stack --
- -- because the first card (which is never deleted) is already --
- -- there. --
- -------------------------------------------------------------------
- go to stack "Overdue"
- if count > 1 then doMenu "New Card"
-
- put bookTitle into field "Title"
- put dueDate into field "Due Date"
- put patronNumber into field "Patron Number"
- put bookAuthor into field "Author"
- put bookNumber into field "Book Number"
- put patName into field "Patron Name"
- put patAddress into field "Patron Address"
-
- end if
-
- pop card -- This returns us to stack "Circulation".
- end ProcessOverdue
- -------------------------- End Open Stack‚Ñ¢ ------------------------
-
-
- -- part 11 (field)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=348 top=218 right=236 bottom=420
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Book Number
- ----- HyperTalk script -----
- on closeField
- global bookNumber
- put card field "Book Number" into bookNumber
- end closeField
-
-
- -- part 13 (button)
- -- low flags: 00
- -- high flags: E005
- -- rect: left=230 top=235 right=258 bottom=363
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Auto Numbering
- ----- HyperTalk script -----
- on mouseUp
- global autoNumbering
- put the hilite of button "Auto Numbering" into autoNumbering
- end mouseUp
-
-
-
- -- part 17 (field)
- -- low flags: 01
- -- high flags: 0000
- -- rect: left=16 top=36 right=52 bottom=315
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: today's date
-
-
- -- part 18 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=141 top=59 right=73 bottom=181
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Vendor
- ----- HyperTalk script -----
- on mouseUp
- go to stack "Vendor"
- end mouseUp
-
-
-
- -- part 19 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=162 top=82 right=97 bottom=208
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Return Slip
- ----- HyperTalk script -----
- on mouseUp
- go to stack "Return Note"
- end mouseUp
-
-
-
- -- part 20 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=138 top=105 right=120 bottom=174
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Catalog
- ----- HyperTalk script -----
- on mouseUp
- go to stack "Cataloging"
- end mouseUp
-
-
-
- -- part 21 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=41 top=130 right=145 bottom=87
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Reserve Note
- ----- HyperTalk script -----
- on mouseUp
- go to stack "Reserve Note"
- end mouseUp
-
-
-
- -- part 22 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=162 top=131 right=146 bottom=208
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Overdue Note
- ----- HyperTalk script -----
- on mouseUp
- go to stack "Overdue Note"
- end mouseUp
-
-
-
- -- part 23 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=103 top=130 right=145 bottom=139
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Circulation
- ----- HyperTalk script -----
- on mouseUp
- go to stack "Circulation"
- end mouseUp
-
-
-
- -- part 24 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=137 top=157 right=171 bottom=177
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Overdue
- ----- HyperTalk script -----
- on mouseUp
- go to stack "Overdue"
- end mouseUp
-
-
-
- -- part 25 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=65 top=105 right=120 bottom=101
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Labels
- ----- HyperTalk script -----
- on mouseUp
- go to stack "Labels"
- end mouseUp
-
-
-
- -- part 26 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=66 top=157 right=171 bottom=106
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Patron
- ----- HyperTalk script -----
- on mouseUp
- go to stack "Patron"
- end mouseUp
-
-
-
- -- part 29 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=370 top=293 right=315 bottom=496
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Process Reserves
- ----- HyperTalk script -----
- on mouseUp
- ---------------------------------------------------------------
- -- This routine processes the reserve stack by deleting all --
- -- the cards for reserved books that have over-run their --
- -- reserve hold periods. --
- ---------------------------------------------------------------
-
- ---------------------------------------------------------
- -- Erase the time so people don't get disoriented... --
- ---------------------------------------------------------
- put the long date into card field "today's date"
- set cursor to 4
- set lockScreen to true
- push card
- go to stack "Reserve Note"
- ------------------------------------------------------------
- -- We must compare the hold date to today's date in the --
- -- seconds format. --
- ------------------------------------------------------------
- put the short date into todayDate
- convert todayDate to seconds
-
- ---------------------------------------------------------------
- -- When a reserve notice is deleted, we must also delete the --
- -- patron's number off the reserve list for that book, if, --
- -- that is, it still exists. bookList records the list of --
- -- book numbers for the deleted reserve notices, and --
- -- patronList the corresponding patron numbers. --
- ---------------------------------------------------------------
- put empty into bookList
- put empty into patronList
- repeat with i = the number of cards down to 1
- go to card i
- --------------------------------------------------------------
- -- Compare the hold date to today's date and delete the --
- -- card if the reserve has run out... --
- --------------------------------------------------------------
- put field "Hold Date" of card i into holdDate
- convert holdDate to seconds
- if holdDate < todayDate then
- put space & field "Book Number" after bookList
- put space & field "Patron Number" after patronList
- if the number of cards > 1 then
- doMenu "Delete Card"
- else
- repeat with k = 1 to 7
- put empty into field k
- end repeat
- end if
- end if
- end repeat
-
- -----------------------------------------------------------------
- -- Next we go to the circulation stack and take the patron's --
- -- number off the top of the reserve list if its still there --
- -- bookList contains the book numbers that we look at and --
- -- patronList patron's number who reserved the book. --
- -----------------------------------------------------------------
- if word 1 of bookList is not empty then
- go to stack "Circulation"
-
- -- Cycle through the book numbers of bookList...--
-
- repeat with i = 1 to the number of words in bookList
- find word i in field "Book Number"
- processField "Reserve Field" -- Tidy the reserve field.
- --------------------------------------------------------
- -- And delete the top patron number off the reserve --
- -- list only if it agrees with the patron number --
- -- whose reserve ran out. --
- --------------------------------------------------------
- if (field "Reserve Field" is not empty) and (word 1 of line 1 of field "Reserve Field" is word i of patronList)
- then delete line 1 of field "Reserve Field"
- end repeat
- end if
-
- pop card
- set lockScreen to false
- end mouseUp
-
-
-
- -- part contents for card part 6
- ----- text -----
- 3000
-
- -- part contents for card part 8
- ----- text -----
- 3004
-
- -- part contents for card part 10
- ----- text -----
- 3004
-
- -- part contents for card part 17
- ----- text -----
- Friday, December 4, 1987 4:09 PM